/*
 * XML Type:  objectPropertiesType
 * Namespace: info:fedora/fedora-system:def/foxml#
 * Java type: fedora.fedoraSystemDef.foxml.ObjectPropertiesType
 *
 * Automatically generated - do not modify.
 */
package fedora.fedoraSystemDef.foxml.impl;
/**
 * An XML objectPropertiesType(@info:fedora/fedora-system:def/foxml#).
 *
 * This is a complex type.
 */
public class ObjectPropertiesTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements fedora.fedoraSystemDef.foxml.ObjectPropertiesType
{
    private static final long serialVersionUID = 1L;
    
    public ObjectPropertiesTypeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName PROPERTY$0 = 
        new javax.xml.namespace.QName("info:fedora/fedora-system:def/foxml#", "property");
    private static final javax.xml.namespace.QName EXTPROPERTY$2 = 
        new javax.xml.namespace.QName("info:fedora/fedora-system:def/foxml#", "extproperty");
    
    
    /**
     * Gets array of all "property" elements
     */
    @SuppressWarnings({ "rawtypes", "unchecked" })
	public fedora.fedoraSystemDef.foxml.PropertyType[] getPropertyArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PROPERTY$0, targetList);
            fedora.fedoraSystemDef.foxml.PropertyType[] result = new fedora.fedoraSystemDef.foxml.PropertyType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "property" element
     */
    public fedora.fedoraSystemDef.foxml.PropertyType getPropertyArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            fedora.fedoraSystemDef.foxml.PropertyType target = null;
            target = (fedora.fedoraSystemDef.foxml.PropertyType)get_store().find_element_user(PROPERTY$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "property" element
     */
    public int sizeOfPropertyArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PROPERTY$0);
        }
    }
    
    /**
     * Sets array of all "property" element
     */
    public void setPropertyArray(fedora.fedoraSystemDef.foxml.PropertyType[] propertyArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(propertyArray, PROPERTY$0);
        }
    }
    
    /**
     * Sets ith "property" element
     */
    public void setPropertyArray(int i, fedora.fedoraSystemDef.foxml.PropertyType property)
    {
        synchronized (monitor())
        {
            check_orphaned();
            fedora.fedoraSystemDef.foxml.PropertyType target = null;
            target = (fedora.fedoraSystemDef.foxml.PropertyType)get_store().find_element_user(PROPERTY$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(property);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "property" element
     */
    public fedora.fedoraSystemDef.foxml.PropertyType insertNewProperty(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            fedora.fedoraSystemDef.foxml.PropertyType target = null;
            target = (fedora.fedoraSystemDef.foxml.PropertyType)get_store().insert_element_user(PROPERTY$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "property" element
     */
    public fedora.fedoraSystemDef.foxml.PropertyType addNewProperty()
    {
        synchronized (monitor())
        {
            check_orphaned();
            fedora.fedoraSystemDef.foxml.PropertyType target = null;
            target = (fedora.fedoraSystemDef.foxml.PropertyType)get_store().add_element_user(PROPERTY$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "property" element
     */
    public void removeProperty(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PROPERTY$0, i);
        }
    }
    
    /**
     * Gets array of all "extproperty" elements
     */
    @SuppressWarnings({ "unchecked", "rawtypes" })
	public fedora.fedoraSystemDef.foxml.ExtpropertyType[] getExtpropertyArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(EXTPROPERTY$2, targetList);
            fedora.fedoraSystemDef.foxml.ExtpropertyType[] result = new fedora.fedoraSystemDef.foxml.ExtpropertyType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "extproperty" element
     */
    public fedora.fedoraSystemDef.foxml.ExtpropertyType getExtpropertyArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            fedora.fedoraSystemDef.foxml.ExtpropertyType target = null;
            target = (fedora.fedoraSystemDef.foxml.ExtpropertyType)get_store().find_element_user(EXTPROPERTY$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "extproperty" element
     */
    public int sizeOfExtpropertyArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(EXTPROPERTY$2);
        }
    }
    
    /**
     * Sets array of all "extproperty" element
     */
    public void setExtpropertyArray(fedora.fedoraSystemDef.foxml.ExtpropertyType[] extpropertyArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(extpropertyArray, EXTPROPERTY$2);
        }
    }
    
    /**
     * Sets ith "extproperty" element
     */
    public void setExtpropertyArray(int i, fedora.fedoraSystemDef.foxml.ExtpropertyType extproperty)
    {
        synchronized (monitor())
        {
            check_orphaned();
            fedora.fedoraSystemDef.foxml.ExtpropertyType target = null;
            target = (fedora.fedoraSystemDef.foxml.ExtpropertyType)get_store().find_element_user(EXTPROPERTY$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(extproperty);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "extproperty" element
     */
    public fedora.fedoraSystemDef.foxml.ExtpropertyType insertNewExtproperty(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            fedora.fedoraSystemDef.foxml.ExtpropertyType target = null;
            target = (fedora.fedoraSystemDef.foxml.ExtpropertyType)get_store().insert_element_user(EXTPROPERTY$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "extproperty" element
     */
    public fedora.fedoraSystemDef.foxml.ExtpropertyType addNewExtproperty()
    {
        synchronized (monitor())
        {
            check_orphaned();
            fedora.fedoraSystemDef.foxml.ExtpropertyType target = null;
            target = (fedora.fedoraSystemDef.foxml.ExtpropertyType)get_store().add_element_user(EXTPROPERTY$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "extproperty" element
     */
    public void removeExtproperty(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(EXTPROPERTY$2, i);
        }
    }
}
